using System.Reflection;
using Microsoft.EntityFrameworkCore;
using UserMgr.Domain.Entities;

namespace UserMgr.Infrastracture;

public class UserDbContext:DbContext
{
    public DbSet<User> Users { get; set; }
    public DbSet<UserLoginHistory> UserLoginHistories { get; set; }
    public UserDbContext(DbContextOptions<UserDbContext> opt):base(opt)
    {
        
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
    }
}